package main

import (
	"github.com/gin-gonic/gin"
	"github.com/sirupsen/logrus"
	"my_logrus_study/Gin_Integration_Logrus"
)

func main() {

	Gin_Integration_Logrus.InitFile("Gin_Integration_Logrus/log", "server")
	router := gin.New()
	router.Use(Gin_Integration_Logrus.LogMiddleware())

	router.GET("/", func(c *gin.Context) {
		logrus.Info("来了")
		c.JSON(200, gin.H{"msg": "你好"})
	})
	router.Run(":8081")

}
